package cn.mavor.day0903;

import java.util.Scanner;

public class separatedsum {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        System.out.println("输入一个整数：");
        int num = sc.nextInt();
        int sum = 0;
        while(num > 0){
            sum += num%10;
            num /= 10;
        }
        System.out.println("所有位上的数字和为"+sum);
    }
}
